﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace LabMS.Web.BaseData
{
    public partial class ClassListByDBlick : System.Web.UI.Page
    {
        ExtendBLL.Class EC = new ExtendBLL.Class();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitBind();
            }
        }

        /// <summary>
        /// 页面初始化绑定
        /// </summary>
        protected void InitBind()
        {
            gvClass.DataSource = EC.GetListByStr().Tables[0].DefaultView;
            gvClass.DataBind();
        }

        protected void gvClass_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gvClass.PageIndex = e.NewPageIndex;
            InitBind();
        }

        protected void gvClass_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';this.style.color='#003399'");
                //e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#6699FF';this.style.color='#8C4510'");
                e.Row.Attributes["style"] = "Cursor:pointer";
                e.Row.Attributes.Add("OnDblClick", "DbClickEvent('" + e.Row.Cells[1].Text + "','" + e.Row.Cells[3].Text + "')");
            }
        }
    }
}
